#include <stdio.h>
int main(int argc, char** argv) {
    float weight;         // weight of apple
    scanf("%f", &weight);

    if (weight <= 5) {
        // price = 3 if weight <= 5
        printf("%f\n", weight * 3.0);  
    } else {
        // 80% discount when over 5
        printf("%f\n", (weight - 5) * 2.4 + 15.0);
    }

    return 0;
}